<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>机房管理软件</title>
    <meta name="description" content="这是一个 logList 页面">
    <meta name="keywords" content="logList">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="icon" type="image/png" href="${ctx}/assets/i/favicon.png">
    <link rel="apple-touch-icon-precomposed" href="${ctx}/assets/i/app-icon72x72@2x.png">
    <meta name="apple-mobile-web-app-title" content="Amaze UI" />
    <link rel="stylesheet" href="${ctx}/assets/css/amazeui.min.css" />
    <link rel="stylesheet" href="${ctx}/assets/css/admin.css">
    <link rel="stylesheet" href="${ctx}/assets/css/app.css">
    <link rel="stylesheet" href="${ctx}/assets/css/layer.css">
    <link rel="stylesheet" type="text/css" href="${ctx}/assets/css/xcConfirm.css"/>
    <style>
        .my-li-a{
            float: left;
            display: inline-block;
            font-size: 18px;
            line-height: 18px;
            padding: 10px 0;
            color: #32c5d2!important;
            font-weight: 700!important;
        }
    </style>
</head>

<body data-type="chart">

            <!--标题-->
            <div class="tpl-content-page-title">
               日志
            </div>
            <!--面包屑-->
            <!-- <ol class="am-breadcrumb">
                <li><a href="#" class="am-icon-home">首页</a></li>
                <li><a href="#">管理</a></li>
                <li class="am-active">日志管理</li>
            </ol> -->
            <div class="tpl-portlet-components am-tabs" data-am-tabs="{noSwipe: 1}" id="list-tab">
                <div class="portlet-title am-tabs-nav am-nav am-nav-tabs" style="height: 48px; min-width: 1080px">
                    <li class="am-active"><a href="javascript: void(0)" class="my-li-a" tabNum="1">平台日志</a></li>
                    <!-- <li><a href="javascript: void(0)" class="my-li-a" tabNum="2">算法日志</a></li> -->
                    <div style="float: right;margin-right: 25px;">
                        <div style="display: inline-block;width: 500px;">
                            <div class="am-u-sm-6">
                                <button type="button" class="am-btn am-btn-default am-margin-right" id="my-start">开始日期</button><span id="my-startDate"></span>
                            </div>
                            <div class="am-u-sm-6">
                                <button type="button" class="am-btn am-btn-default am-margin-right" id="my-end">结束日期</button><span id="my-endDate"></span>
                            </div>
                        </div>
                        <div style="display: inline-block;width: 300px;">
                            <div class="am-input-group">
                                <input type="text" class="am-form-field" placeholder="  搜索内容..." id="searchContent">
                                <span class="am-input-group-btn">
                                    <button class="am-btn am-btn-default" type="button" id="logSearch"><span class="am-icon-search"></span></button>
                                </span>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="am-tabs-bd">
                    <div class="am-tab-panel am-active">
                        <input type="hidden" id="logIsSearch" value="0"/>
                        <input type="hidden" id="logStartDateTemp" value=""/>
                        <input type="hidden" id="logEndDateTemp" value=""/>
                        <input type="hidden" id="logSearchContentTemp" value=""/>
                        <div class="am-g">
                            <div class="am-u-sm-12">
                                <table class="am-table am-table-striped am-table-hover table-main" id="logTableList">
                                    <thead>
                                    <tr>
                                        <th style="min-width: 50px;">序号</th>
                                        <th style="min-width: 80px;">日志级别</th>
                                        <th style="min-width: 75px;">操作对象</th>
                                        <th style="min-width: 80px;">操作类型</th>
                                        <th>日志记录</th>
                                        <th style="min-width: 100px;">操作时间</th>
                                        <th style="min-width: 80px;">操作人员</th>
                                    </tr>
                                    </thead>
                                </table>
                                <div class="am-cf am-center">
                                    <div id="prePage1" style="text-align: center;" am-pagination="pagination_1" pagenumber="1" totalpage="6"></div>
                                </div>
                                <hr>
                            </div>
                        </div>
                    </div>
                    <div class="am-tab-panel">
                        <input type="hidden" id="runIsSearch" value="0"/>
                        <input type="hidden" id="runStartDateTemp" value=""/>
                        <input type="hidden" id="runEndDateTemp" value=""/>
                        <input type="hidden" id="runSearchContentTemp" value=""/>
                        <input type="hidden" id="currentTab" value="1"/>
                        <div class="am-g">
                            <div class="am-u-sm-12" style="overflow-x: auto">
                                <table class="am-table am-table-striped am-table-hover table-main" id="runTableList">
                                    <thead>
                                    <tr>
                                        <th style="min-width: 50px;">序号</th>
                                        <th style="min-width: 80px;">算法进度</th>
                                        <th style="min-width: 80px;">算法状态</th>
                                        <th style="min-width: 100px;">算法日志文件</th>
                                        <th style="min-width: 80px;">日志级别</th>
                                        <!--<th>日志消息</th>-->
                                        <th style="min-width: 80px;">算法名称</th>
                                        <th style="min-width: 80px;">任务名称</th>
                                        <th style="min-width: 100px;">记录时间</th>
                                        <th style="min-width: 85px;">操作</th>
                                    </tr>
                                    </thead>
                                </table>
                                <div class="am-cf am-center">
                                    <div id="prePage2" style="text-align: center;" am-pagination="pagination_2" pagenumber="1" totalpage="6"></div>
                                </div>
                                <hr>
                            </div>
                        </div>
                    </div>
                </div>

            </div>

<script src="${ctx}/assets/js/jQuery/jquery-1.9.1.js"></script>
<script src="${ctx}/assets/js/jQuery/jquery.min.js"></script>
<script src="${ctx}/assets/js/common/amazeui.min.js"></script>
<script src="${ctx}/assets/js/common/xcConfirm.js"></script>
<script src="${ctx}/assets/js/common/config.js"></script>
<script src="${ctx}/assets/js/common/app.js"></script>
<script src="${ctx}/assets/js/layer/layer.js"></script>
<script src="${ctx}/assets/js/log/logList.js"></script>
<script>
    $(function () {
        var myDate = new Date();
        var startDate = new Date(1, 1, 1);
        var endDate = new Date(myDate.getFullYear(), myDate.getMonth(), myDate.getDate());
        $('#my-endDate').text(myDate.getFullYear()+"-"+parseInt(myDate.getMonth()+1)+"-"+myDate.getDate());
        $('#endDateTemp').val(myDate.getFullYear()+"-"+parseInt(myDate.getMonth()+1)+"-"+myDate.getDate());
        $('#my-start').datepicker().
        on('changeDate.datepicker.amui', function(event) {
            console.log(endDate.valueOf());
            console.log(event.date.valueOf());
            if (event.date.valueOf() > endDate.valueOf()) {
                layer.alert('开始日期应小于结束日期！');
            } else {
                startDate = new Date(event.date);
                $('#my-startDate').text($('#my-start').data('date'));
            }
            $(this).datepicker('close');
        });

        $('#my-end').datepicker().
        on('changeDate.datepicker.amui', function(event) {
            if (event.date.valueOf() < startDate.valueOf()) {
                layer.alert('结束日期应大于开始日期！');
            } else {
                endDate = new Date(event.date);
                $('#my-endDate').text($('#my-end').data('date'));
            }
            $(this).datepicker('close');
        });
        $.ajax({
            type: "POST",
            url: constUrl+"log/list",
            dataType: "json",
            data: {
                onePageCount: "10",
                currentPage: "1"
            },
            success: function (data) {
                addPageNum(data.result.pageNum, '1');
                addBox(data.result.logs, 'logTableList');
                paginationInit('1');
            }
        });
        $.ajax({
            type: "POST",
            url: constUrl+"socketlog/list",
            dataType: "json",
            data: {
                onePageCount: "10",
                currentPage: "1"
            },
            success: function (data) {
                addPageNum(data.result.pageNum, '2');
                addBox(data.result.logs, 'runTableList');
                paginationInit('2');
            }
        });
    });
</script>
</body>

</html>